1、解压ST的源码
	tar -xvf en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar.xz
2、进入stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.01-r0/目录
	cd stm32mp1-openstlinux-5.4-dunfell-mp1-20-06-24/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.01-r0/
3、解压TFA源码
	tar -vxf u-boot-stm32mp-2020.01-r0.tar.gz
4、进入uboot源码目录
	cd u-boot-stm32mp-2020.01/
5、为uboot打上ST的补丁
	for p in `ls -1 ../*.patch`; do patch -p1 < $p; done
6、进行编译测试
	make distclean
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- stm32mp15_trusted_defconfig
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- DEVICE_TREE=stm32mp157d-ev1 all -j8
7、创建默认配置文件
	cp configs/stm32mp15_trusted_defconfig configs/stm32mp15_atk_trusted_defconfig
8、创建设备树
	开发板参考STM32MP157D EVK设计，其设备树是stm32mp157d-ev1，又因stm32mp157d-ev1引用 stm32mp157d-ed1，所以这里以stm32mp157d-ed1为蓝本
	stm32mp157d-ed1.dts描述ed1开发板的特有属性
	cp arch/arm/dts/stm32mp157d-ed1.dts arch/arm/dts/stm32mp157d-atk.dts
	stm32mp15xx-edx.dtsi描述ed系列开发板公共属性
	cp arch/arm/dts/stm32mp15xx-edx.dtsi arch/arm/dts/stm32mp157d-atk.dtsi
	uboot构建时可以包含一个公共的dtsi文件，这里以stm32mp157a-ed1为蓝本，因为stm32mp157d-ed1-u-boot.dtsi直接包含stm32mp157a-ed1-u-boot.dtsi
	cp arch/arm/dts/stm32mp157a-ed1-u-boot.dtsi arch/arm/dts/stm32mp157d-atk-u-boot.dtsi
9、修改设备树stm32mp157d-atk.dts
	gedit arch/arm/dts/stm32mp157d-atk.dts
	将14行的stm32mp15xx-edx.dtsi修改为stm32mp157d-atk.dtsi
	将17行的STMicroelectronics STM32MP157D eval daughter修改为Alientek STM32MP157DAA development board
	将18行stm32mp157d-ed1修改为stm32mp157d-atk
	在跟节点中添加节点panel_backlight：
		panel_backlight: panel-backlight {
			compatible = "gpio-backlight";
			gpios = <&gpiod 13 GPIO_ACTIVE_HIGH>;
			default-on;
			status = "okay";
		};
	在跟节点中节点panel_rgb：
		panel_rgb: panel-rgb {
			compatible = "simple-panel";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&ltdc_pins_b>;
			pinctrl-1 = <&ltdc_pins_sleep_b>;
			backlight = <&panel_backlight>;
			status = "okay";
	
			port {
				panel_in_rgb: endpoint {
					remote-endpoint = <&ltdc_ep0_out>;
				};
			};
	
			display-timings {
				native-mode = <&timing0>;
				timing0: timing0 {
					clock-frequency = <31000000>;
					hactive = <800>;
					vactive = <480>;
					hfront-porch = <40>;
					hback-porch = <88>;
					hsync-len = <48>;
					vback-porch = <32>;
					vfront-porch = <13>;
					vsync-len = <13>;
				};
			};
		};
	添加&ltdc节点：
		&ltdc {
			status = "okay";
			pinctrl-names = "default";
			port {
				#address-cells = <1>;
				#size-cells = <0>;
			
				ltdc_ep0_out: endpoint@0 {
					reg = <0>;
					remote-endpoint = <&panel_in_rgb>;
				};
			};
		};
10、修改设备树stm32mp157d-atk-u-boot.dtsi
	gedit arch/arm/dts/stm32mp157d-atk-u-boot.dtsi
	删除config节点中的：
		st,fastboot-gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
		st,stm32prog-gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
	删除跟节点中的led节点中的类容，但保留此节点
	删除&pmic节点
	添加&usbotg_hs节点：
		&usbotg_hs {
			u-boot,force-b-session-valid;
			hnp-srp-disable;
			/* TEMP: force peripheral for USB OTG */
			dr_mode = "peripheral";
		};
11、修改设备树stm32mp157d-atk.dtsi
	gedit arch/arm/dts/stm32mp157d-atk.dtsi
	删除&adc节点
	删除&dac节点
	删除&i2c4节点
	删除跟节点中的led节点
	删除跟节点中的sd_switch节点
	在跟节点中添加电源说明节点：
		vddcore: regulator-vddcore {
			compatible = "regulator-fixed";
			regulator-name = "vddcore";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1350000>;
			regulator-always-on;
			regulator-boot-on;
		};
		
		v3v3: regulator-3p3v {
			compatible = "regulator-fixed";
			regulator-name = "v3v3";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
			regulator-boot-on;
		};
		
		v1v8_audio: regulator-v1v8-audio {
			compatible = "regulator-fixed";
			regulator-name = "v1v8_audio";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
			regulator-boot-on;
		};
		
		vdd: regulator-vdd {
			compatible = "regulator-fixed";
			regulator-name = "vdd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
			regulator-boot-on;
		};
		
		vdd_usb: regulator-vdd-usb {
			compatible = "regulator-fixed";
			regulator-name = "vdd_usb";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-always-on;
			regulator-boot-on;
		};
	修改&sdmmc1节点：
		&sdmmc1 {
			pinctrl-names = "default", "opendrain", "sleep";
			pinctrl-0 = <&sdmmc1_b4_pins_a>;
			pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
			pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
			st,neg-edge;
			broken-cd;
			bus-width = <4>;
			vmmc-supply = <&v3v3>;
			status = "okay";
		};
	修改&sdmmc2节点：
		&sdmmc2 {
			pinctrl-names = "default", "opendrain", "sleep";
			pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
			pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_a>;
			pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_a>;
			non-removable;
			st,neg-edge;
			bus-width = <8>;
			vmmc-supply = <&v3v3>;
			keep-power-in-suspend;
			status = "okay";
		};
	增加描述网卡的节点：
		&ethernet0 {
			status = "okay";
			pinctrl-0 = <&ethernet0_rgmii_pins_a>;
			pinctrl-1 = <&ethernet0_rgmii_pins_sleep_a>;
			pinctrl-names = "default", "sleep";
			phy-mode = "rgmii-id";
			max-speed = <1000>;
			phy-handle = <&phy0>;
		
			mdio0 {
				#address-cells = <1>;
				#size-cells = <0>;
				compatible = "snps,dwmac-mdio";
				phy0: ethernet-phy@0 {
					reg = <0>;
				};
			};
		};
	在跟节点中添加usb phy的节点：
		usb_phy_tuning: usb-phy-tuning {
			st,hs-dc-level = <2>;
			st,fs-rftime-tuning;
			st,hs-rftime-reduction;
			st,hs-current-trim = <15>;
			st,hs-impedance-trim = <1>;
			st,squelch-level = <3>;
			st,hs-rx-offset = <2>;
			st,no-lsfs-sc;
		};
	在i2c1总线下面添加STUSB1600 USB Type-C控制器芯片节点：
		&i2c1 {
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&i2c1_pins_b>;
			pinctrl-1 = <&i2c1_pins_sleep_b>;
			i2c-scl-rising-time-ns = <100>;
			i2c-scl-falling-time-ns = <7>;
			status = "okay";
			/delete-property/dmas;
			/delete-property/dma-names;
		
			stusb1600@28 {
				compatible = "st,stusb1600";
				reg = <0x28>;
				interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
				interrupt-parent = <&gpiog>;
				pinctrl-names = "default";
				pinctrl-0 = <&stusb1600_pins_a>;
				status = "okay";
				vdd-supply = <&vin>;
		
				connector {
					compatible = "usb-c-connector";
					label = "USB-C";
					power-role = "dual";
					power-opmode = "default";
		
					port {
						con_usbotg_hs_ep: endpoint {
							remote-endpoint = <&usbotg_hs_ep>;
						};
					};
				};
			};
		};
	添加&usbh_ehci节点：
		&usbh_ehci {
			phys = <&usbphyc_port0>;
			status = "okay";
		};
	修改&usbotg_hs节点：
		&usbotg_hs {
			phys = <&usbphyc_port1 0>;
			phy-names = "usb2-phy";
			usb-role-switch;
			status = "okay";
		
			port {
				usbotg_hs_ep: endpoint {
					remote-endpoint = <&con_usbotg_hs_ep>;
				};
			};
		};
	添加&usbphyc节点：
		&usbphyc {
			status = "okay";
		};
	
12、修改设备树目录中的Makefile
	gedit arch/arm/dts/Makefile
	在dtb-$(CONFIG_STM32MP15x)配置项中加入stm32mp157d-atk.dtb
13、修改网络phy驱动
	将phy.c拷贝到drivers/net/phy中，替换原来的phy.c
14、编译
	make distclean
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- stm32mp15_atk_trusted_defconfig 
	make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- DEVICE_TREE=stm32mp157d-atk all -j8
15、配置uboot网络
	setenv ipaddr 192.168.2.250
	setenv ethaddr b8:ae:1d:01:01:00
	setenv gatewayip 192.168.2.1
	setenv netmask 255.255.255.0
	setenv serverip 192.168.2.55
	saveenv
